{% load i18n %}
{% load strings %}
{% trans "Project name" as i18n_asset %}
{% trans "Hook" as i18n_hook %}
{% trans "Submission" as i18n_submission %}
{% trans "Status code" as i18n_status_code %}
{% trans "Message" as i18n_message %}
{% trans "Date" as i18n_date %}

<p>{% trans "Dear" %} {{ username }},</p>
<p>{% trans "Some submissions could not be sent to their external endpoints." %}</p>

{% for asset_uid, asset in assets.items %}
  {% url 'api_v2:asset-detail' uid=asset_uid as asset_url %}
  <p>{{ i18n_asset }}: <b><a href="{{ kpi_base_url }}{{ asset_url }}">{{ asset.name }}</a></b></p>
    <table>
        <tr>
          <th style="border-bottom:1px solid black;">{{ i18n_hook }}</th>
          <th style="border-bottom:1px solid black;">{{ i18n_submission }}</th>
          <th style="border-bottom:1px solid black;">{{ i18n_status_code }}</th>
          <th style="border-bottom:1px solid black;">{{ i18n_message }}</th>
          <th style="border-bottom:1px solid black;">{{ i18n_date }}</th>
        </tr>
        {% for log in asset.logs %}
            <tr>
                <td>{{ log.hook_name }}</td>
                <td>{{ log.uid }}</td>
                <td style="text-align: center">{{ log.status_code }}</td>
                <td>{{ log.message|truncatechars:50 }}</td>
                <td>{{ log.date_modified|date:"Y-m-d H:i" }} UTC</td>
            </tr>
        {% endfor %}
    </table>
{% endfor %}

<p>
{% trans "Best," %}</br>
KoBoToolbox
</p>
